<?php 
require("../../config.php");
$conn = mysqli_connect($host, $user, $password, $dbname);
require("../../function.php");
$config = $bluestar->get_config($conn);
if (!isset($_COOKIE["admin_token"])) {
    die("");
} else {
    if ($_COOKIE["admin_token"] !== md5($config["admin"])) {
        die("");
    }
}
?>
<link rel="stylesheet" href="../../file/css/mdui.min.css">
<script src="../../file/js/mdui.min.js"></script>
<div class="mdui-p-a-5 mdui-typo">
    <h2>退出面板</h2>
    <p>退出后需重新登录</p>
    <button class="mdui-btn mdui-ripple mdui-btn-raised mdui-color-theme-accent">安全退出</button>
</div>
<script>
    !function () {
        mdui.$("button").on("click", function () {
            fetch("../?type=func&target=exit", {
                method: "POST"
            }).then(() => {
                window.top.location.reload();
            });
        });
    }();
</script>